package com.hex.es.service.impl;

import com.hex.es.bulk.EsOperationEnum;
import com.hex.es.entity.EsInfoDomain;
import com.hex.es.service.AbstractEsBatch;
import com.hex.es.service.EsBulkOperationSerivce;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.io.IOException;
import java.util.List;

/**
 * es删除批处理实现类
 *
 * @author hex
 * @date 2019/11/04
 */
@Slf4j
@Service
public class EsBatchDeleteImpl extends AbstractEsBatch {

    @Resource
    private EsBulkOperationSerivce esBulkOperationSerivce;

    @Override
    public EsOperationEnum getType() {
        return EsOperationEnum.DELETE;
    }

    @Override
    public void handler(List<EsInfoDomain> esInfoDomains) throws IOException {
        esBulkOperationSerivce.deleteBatch(esInfoDomains);
    }
}
